<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="en" name="language">
	<title>Magick::PixelPacket Structure</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link media="screen" href="../docutils-articles.css" type="text/css" rel="stylesheet">

</head>

<body>

<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
  <input type="hidden" name="domains" value="www.graphicsmagick.org" />
  <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" />&nbsp;<input type="submit" name="sa" value="Search" /></span>
</form>
</div>


<div class="navmenu">
<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../project.html">Project</a></li>
  <li><a href="../download.html">Download</a></li>
  <li><a href="../README.html">Install</a></li>
  <li><a href="../Hg.html">Source</a></li>
  <li><a href="../NEWS.html">News</a> </li>
  <li><a href="../utilities.html">Utilities</a></li>
  <li><a href="../programming.html">Programming</a></li>
  <li><a href="../reference.html">Reference</a></li>
</ul>
</div>

<main id="magick-pixelpacket-structure">
<h1 class="title">Magick::PixelPacket Structure</h1>
<!-- -*- mode: rst -*- -->
<!-- This text is in reStucturedText format, so it may look a bit odd. -->
<!-- See http://docutils.sourceforge.net/rst.html for details. -->
<p>The PixelPacket structure is used to represent DirectClass pixels in
GraphicsMagick. GraphicsMagick may be compiled to support 32, 64, or
even 128 bit pixels. The size of PixelPacket is controlled by the
value of the QuantumDepth define. The default build depth is 32 bit
pixels, which provides minumum (&quot;web standard&quot;) accuracy, least memory
consumption, and best performance.  If deeper images need to be
supported or more mathematical accuracy is desired, then
GraphicsMagick may be compiled with QuantumDepth=16 or
QuantumDepth=32.</p>
<p>The following table shows the relationship between QuantumDepth, the
type of Quantum, and the overall PixelPacket size:</p>
<table>
<caption>Effect Of QuantumDepth Values</caption>
<colgroup>
<col style="width: 28%" />
<col style="width: 35%" />
<col style="width: 37%" />
</colgroup>
<thead>
<tr><th class="head"><p>QuantumDepth</p></th>
<th class="head"><p>Quantum Type</p></th>
<th class="head"><p>PixelPacket Size</p></th>
</tr>
</thead>
<tbody>
<tr><td><p>8</p></td>
<td><p>unsigned char</p></td>
<td><p>32 bits</p></td>
</tr>
<tr><td><p>16</p></td>
<td><p>unsigned short</p></td>
<td><p>64 bits</p></td>
</tr>
<tr><td><p>32</p></td>
<td><p>unsigned int</p></td>
<td><p>128 bits</p></td>
</tr>
</tbody>
</table>
<p>The members of the PixelPacket structure, and their interpretation,
are shown in the following table:</p>
<table>
<caption>PixelPacket Structure Members</caption>
<colgroup>
<col style="width: 10%" />
<col style="width: 10%" />
<col style="width: 19%" />
<col style="width: 31%" />
<col style="width: 28%" />
</colgroup>
<thead>
<tr><th class="head"><p>Member</p></th>
<th class="head"><p>Type</p></th>
<th class="head" colspan="3"><p>Interpretation</p></th>
</tr>
<tr><th class="head"><p></p></th>
<th class="head"></th>
<th class="head"><p>RGBColorspace</p></th>
<th class="head"><p>RGBColorspace + matte</p></th>
<th class="head"><p>CMYKColorspace</p></th>
</tr>
</thead>
<tbody>
<tr><td><p>red</p></td>
<td><p>Quantum</p></td>
<td><p>Red</p></td>
<td><p>Red</p></td>
<td><p>Cyan</p></td>
</tr>
<tr><td><p>green</p></td>
<td><p>Quantum</p></td>
<td><p>Green</p></td>
<td><p>Green</p></td>
<td><p>Magenta</p></td>
</tr>
<tr><td><p>blue</p></td>
<td><p>Quantum</p></td>
<td><p>Blue</p></td>
<td><p>Blue</p></td>
<td><p>Yellow</p></td>
</tr>
<tr><td><p>opacity</p></td>
<td><p>Quantum</p></td>
<td><p>Ignored</p></td>
<td><p>Opacity</p></td>
<td><p>Black</p></td>
</tr>
</tbody>
</table>
<p>Note that opacity is stored inverted from most other software
(i.e. maximum value is completely transparent and minum value is
totally opaque).</p>
<p>Note that for CMYKColorspace + matte (CMYKA), the opacity is stored in
the assocated IndexPacket.</p>
<p>Copyright © Bob Friesenhahn 1999 - 2022</p>
</main>


<hr class="docutils">
<div class="document">
    <p><a href="../Copyright.html">Copyright</a> © GraphicsMagick Group 2002-2025<!--SPONSOR_LOGO--></p>
</div>

</main>
</body>
</html>
